package eee.xiang.cloud_learning;

import eee.xiang.cloud_learning.common.servlet.MyServlet;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages = "eee.xiang.cloud_learning.dao.mapper")
public class CloudLearningApplication extends WebMvcConfigurationSupport {

    public static void main(String[] args) {
        SpringApplication.run(CloudLearningApplication.class, args);
    }

    @Bean
    public ServletRegistrationBean getServletRegistrationBean(){
        ServletRegistrationBean bean = new ServletRegistrationBean(new MyServlet(), "/myServlet");
        return bean;
    }
}
